package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * 
 * @TableName t_user
 */
@TableName(value ="t_user")
@Data
public class User  extends BaseEntity{


    /**
     * 登录名
     */
    @Schema(description = "登录名(用户名)")
    @Size(min = 1, max = 20, message = "用户名长度必须为1~20")
    @NotBlank(message = "用户名不能为空")
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */

    @Schema(description = "密码")
    @TableField(value = "password")
    private String password;

    /**
     * 工号
     */
    @Schema(description = "工号")
    @Pattern(regexp = "\\d{0,10}$", message = "工号必须为数字")
    @TableField(value = "job_number")
    private String jobNumber;

    /**
     * 性别,0女 1男
     */
    @Schema(description = "性别,0女 1男")
    @DecimalMax(value = "1", message = "性别必须为0|1")
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 是否启用 1启用 0禁用
     */

    @Schema(description = "是否启用 1启用 0禁用")
    @DecimalMax(value = "1", message = "状态必须为0|1")
    @TableField(value = "is_enable")
    private Integer isEnable;


    /**
     * 真实姓名
     */
    @Schema(description = "真实姓名(昵称)")
    @Size(min = 1, max = 20, message = "真实姓名长度必须为1~20")
    @NotNull(message = "昵称不能为空")
    @TableField(value = "real_name")
    private String realName;

    /**
     * 角色类型
     */
    @Schema(description = "角色类型")
    @TableField(value = "role_id")
    private Long roleId;
}